<?php
include_once('class/autoload.php');
//require_once('class/connexpdo.php');
require_once('class/MyPDO.php');
require_once 'PreparationREQ.php';
$site = new page_base('inscription eleve');
$site->titre = "inscription eleve course";

try
{
	$db= new MyPDO('mysql:host=localhost;dbname=bd_ppe3test','root','');

	$PrepREQ = new PreparationREQ($db);
if(isset ($_POST['sexe']))
{if($_POST['sexe']=='h')
{$typeSexe='H';}
if($_POST['sexe']=='f')
{$typeSexe='F';}


if(isset ($_POST['course'])){
	if($_POST['course']=='A')
	{	$course='A';}
	if($_POST['course']=='B')
	{ 	$course='B';}
	
	
}
}
	$PrepREQ->insert($_POST['nom'], $_POST['prenom'], $_POST['datenaiss'],$typeSexe,$course);
}
catch (Exception $e)
{
	die('Erreur : ' . $e->getMessage());

}

$site->affiche();
?>